package com.lmf.service;


import com.lmf.dao.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class UserService {
    @Value(value = "刘明福")
    private String name;
    //添加注入属性注解
//    @Autowired  //根据类型进行注入
    @Resource   //可以根据类型注入，可以根据名称注入
    private UserDao userDao;

    public void show(){
        System.out.println("这是userService类 "+name);
        userDao.show();
    }

}
